﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<LoginData>" %>
<%@ Import Namespace="RecruitmentAgency.Models.DataTypes"%>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Connections - Log On
</asp:Content>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">  
    <div id="centre">       
        <div class="panelTop"></div>
        <div class="panelMiddle padLR20">
            <% using (Html.BeginForm()) { %>
                <% if (ViewData["panel"].ToString() == "Register") { %>
                    <div class="titleLabel">Register as a Job Seeker</div>                 
                    <div class="marginT10 marginB15">
                        If you have already an account, <a href="?Type=Login" id="linkDisplayLoginPanel">Login</a>.
                        You can also register as a <a href="?Type=JobProvider" id="A3" >Job Provider</a>
                    </div>
                    <%=Html.ValidationMessage("RegisterJobSeeker")%>                                     
                    <div class="formColumn">                
                        <div class="formLabel">
                            <label for="UserName">Username:</label>
                        </div>
                        <%= Html.TextBox("RegisterUserName", Model.Register.RegisterUserName)%>
                        <%=Html.ValidationMessage("RegisterUserName")%>
                        <div class="formLabel">
                            <label for="RegisterPassword">Password:</label>
                        </div>
                        <%= Html.Password("RegisterPassword", Model.Register.RegisterPassword)%>
                        <%=Html.ValidationMessage("RegisterPassword")%>
                        <div class="formLabel">
                            <label for="RegisterConfirmPassword">Confirm password:</label>
                        </div>
                        <%= Html.Password("RegisterConfirmPassword", Model.Register.RegisterConfirmPassword)%>
                        <%=Html.ValidationMessage("RegisterConfirmPassword")%>
                        <div class="formLabel">
                            <label for="PersonalEmail">Personal e-mail:</label>
                        </div>
                        <%= Html.TextBox("PersonalEmail", Model.Register.PersonalEmail)%>
                        <%=Html.ValidationMessage("PersonalEmail")%>                  
                    </div>
                    <div class="formColumn">
                        <div class="formLabel">
                            <label for="RegisterTitle">Title:</label>
                        </div>
                         <%=Html.DropDownList("RegisterTitle", (SelectList)ViewData["titles"], new { @class = "dropDownList" })%>
                         <%=Html.ValidationMessage("RegisterTitle")%>
                        <div class="formLabel">
                            <label for="RegisterFirstName">First name:</label>
                        </div>
                        <%= Html.TextBox("RegisterFirstName", Model.Register.RegisterFirstName)%>
                        <%=Html.ValidationMessage("RegisterFirstName")%>
                        <div class="formLabel">
                            <label for="RegisterLastName">Last name:</label>
                        </div>
                        <%= Html.TextBox("RegisterLastName", Model.Register.RegisterLastName)%>
                        <%=Html.ValidationMessage("RegisterLastName")%>               
                        <input name="LogInButton" class="formButton" id="RegisterButton" type="submit" value="Register" />                
                    </div>
                <% } else if (ViewData["panel"].ToString() == "JobProvider") { %>
                    <div class="titleLabel">Register as a Job Provider</div>
                    <div class="marginT10 marginB15">
                        If you have already an account, <a href="?Type=Login" id="A5">Login</a>.
                        You can also register as a <a href="?Type=Register" id="A6" >Job Seeker</a>
                    </div>
                    <%=Html.ValidationMessage("RegisterJobProvider")%>                                     
                    <div class="formColumn">
                        <div class="formLabel">
                            <label for="CompanyName">Company name:</label>
                        </div>
                        <%= Html.TextBox("CompanyName", Model.RegisterJobProvider.CompanyName)%>
                        <%=Html.ValidationMessage("CompanyName")%>                                     
                        <div class="formLabel">
                            <label for="RegistrationNumber">Registration number:</label>
                        </div>
                        <%= Html.TextBox("RegistrationNumber", Model.RegisterJobProvider.RegistrationNumber)%>
                        <%=Html.ValidationMessage("RegistrationNumber")%>               
                        <div class="formLabel">
                            <label for="AddressLine1">Address line 1:</label>
                        </div>
                        <%=Html.TextBox("AddressLine1", Model.RegisterJobProvider.AddressLine1)%>
                        <%=Html.ValidationMessage("AddressLine1")%>
                        <div class="formLabel">
                            <label for="AddressLine2">Address line 2:</label>
                        </div>
                        <%=Html.TextBox("AddressLine2", Model.RegisterJobProvider.AddressLine2)%>
                        <%=Html.ValidationMessage("AddressLine2")%>
                        <div class="formLabel">
                            <label for="Town">Town/City:</label>
                        </div>
                        <%=Html.TextBox("Town", Model.RegisterJobProvider.Town)%>
                        <%=Html.ValidationMessage("Town")%>
                        <div class="formLabel">
                            <label for="PostCode">Post code:</label>
                        </div>
                        <%=Html.TextBox("PostCode", Model.RegisterJobProvider.PostCode)%>
                        <%=Html.ValidationMessage("PostCode")%>  
                        <div class="formLabel">
                            <label for="WebsiteUrl">Website URL:</label>
                        </div>
                        <%= Html.TextBox("WebsiteUrl", Model.RegisterJobProvider.WebsiteUrl)%>
                        <%=Html.ValidationMessage("WebsiteUrl")%>
                    </div>
                    <div class="formColumn">
                        <div class="formLabel">
                            <label for="Title">Title:</label>
                        </div>
                         <%=Html.DropDownList("Title", (SelectList)ViewData["titles"], new { @class = "dropDownList" })%>
                         <%=Html.ValidationMessage("Title")%>
                        <div class="formLabel">
                            <label for="firstName">First name:</label>
                        </div>
                        <%= Html.TextBox("FirstName", Model.RegisterJobProvider.FirstName)%>
                        <%=Html.ValidationMessage("FirstName")%>
                        <div class="formLabel">
                            <label for="LastName">Last name:</label>
                        </div>
                        <%= Html.TextBox("LastName", Model.RegisterJobProvider.LastName)%>
                        <%=Html.ValidationMessage("LastName")%>               
                        <div class="formLabel">
                            <label for="JobProviderUserName">Username:</label>
                        </div>
                        <%= Html.TextBox("JobProviderUserName", Model.RegisterJobProvider.JobProviderUserName)%>
                        <%=Html.ValidationMessage("JobProviderUserName")%>
                        <div class="formLabel">
                            <label for="JobProviderPassword">Password:</label>
                        </div>
                        <%= Html.Password("JobProviderPassword", Model.RegisterJobProvider.JobProviderPassword)%>
                        <%=Html.ValidationMessage("JobProviderPassword")%>
                        <div class="formLabel">
                            <label for="JobProviderConfirmPassword">Confirm password:</label>
                        </div>
                        <%= Html.Password("JobProviderConfirmPassword", Model.RegisterJobProvider.JobProviderConfirmPassword)%>
                        <%=Html.ValidationMessage("JobProviderConfirmPassword")%>        
                        <div class="formLabel">
                            <label for="Email">Work e-mail:</label>
                        </div>
                        <%= Html.TextBox("Email", Model.RegisterJobProvider.Email)%>
                        <%=Html.ValidationMessage("Email")%>               
                        <input name="LogInButton" class="formButton" id="Submit1" type="submit" value="Register" />
                    </div>
                <% } else if (ViewData["panel"].ToString() == "LogIn") { %>
                    <div class="titleLabel">Log In</div>
                    <div class="marginT10 marginB15">
                        Please enter your Username and password.                             
                        If you don't have an account, you can register as either a <a href="?Type=Register" id="registerLink" >Job Seeker</a>
                        or a <a href="?Type=JobProvider" id="A2" >Job Provider</a>
                    </div>
                    <%= Html.ValidationMessage("Login", "")%>
                    <div class="formColumn">
                        <div class="formLabel">
                            <label for="UserName">Username</label>
                        </div>
                        <%= Html.TextBox("UserName")%>
                        <%= Html.ValidationMessage("UserName", "")%>
                        <div class="formLabel">
                            <label for="Password">Password:</label>
                        </div>
                        <%= Html.Password("Password")%>
                        <%= Html.ValidationMessage("Password")%>
                        <div class="formLabel">
                            <%= Html.CheckBox("RememberMe", new { @class = "floatRight" })%> <label class="floatRight" for="RememberMe">Remember me:</label>
                        </div>                       
                        <input name="LogInButton" class="formButtonTight" id="LogInButton" type="submit" value="Log in" />
                    </div>
                <% } %>
            <% } %>
        </div>
        <div class="panelBottom"></div>
    </div>     
</asp:Content>